﻿Imports System.Data.SqlClient

Public Class cn_certificate
    Inherits System.Web.UI.Page
    Dim objrd As SqlDataReader = Nothing

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sSQL As String = ""
        Dim strErr As String = ""
        Dim objdt As New GetData
        Dim ps As New PreparedStatement(sSQL)
        Dim comId As String
        comId = Request("cid")
        
        If comId <> Nothing And comId <> "" Then
            ps.addParameter("cid", comId)
            sSQL = "select *  from  merchant_info where company_id=@cid and lang_flag='zh'"
            ps.strSql = sSQL
            Dim conn As SqlConnection = objdt.getConn()

            objrd = objdt.dr(ps, strErr, conn, objrd)
            If Not objrd.Read() Then
                objdt.closeConn(conn)
                Exit Sub
            End If
            title.InnerHtml += ":" & objrd.Item("company_name").ToString
            companyName.InnerText = objrd.Item("company_name").ToString
            sSQL = "select *  from  merchant_photo where company_id=@cid"
            ps.strSql = sSQL
            objrd = objdt.dr(ps, strErr, conn, objrd)
            certificate.InnerHtml = "<table width=""100%"">"
            While (objrd.Read())
                certificate.InnerHtml += "<tr>"
                certificate.InnerHtml += "<td  valign=""top""><img src=""" & objrd("path").ToString & """ /></td>"
                certificate.InnerHtml += "</tr>"
            End While
            objdt.closeConn(conn)

            certificate.InnerHtml += "</table>"
        Else
            Response.Redirect("cn_index.aspx")
        End If
    End Sub

End Class